home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Programmer Disk
/
The Programmer Disk (Microforum).iso
/
xpro
/
vbdos
/
pro5
/
trueerr.txt
< prev
Wrap
Text File
|
1993-07-19
|
2KB
|
49 lines
BOMB.BAS and TrueErr.OBJ
I know how frustrating it is for programmers using PDS and VBDOS to have a
program that might need to terminate because of a specific error. Yet if the
program terminates from within the error handler, the resulting message
displays the address of the error handler rather than the offending statement!
Apparently Microsoft has no plans to address this problem.
I offer you this solution: "TrueErr". (c) 1993 Thomas Kiehl
When you generate a "*.LST" file, each line of your program has and address
assigned to it. By looking at the result printed on the screen when a program
terminates because of an error, you would think that you could go back into
your LST file and find the culprit. Well, you usually can... unless you are
already in the error handler and then terminate the program. Then the address
given by the termination routines in VBDOS is the error handler itself. Not
very helpful indeed! By linking the file "TrueErr.OBJ" you can now get the
address in a LONG integer as segment/offset. The segment is the 'high word' and
the offset is the 'low word'. They can be extracted by "offset = z& MOD &H1000"
and "segment = z& \ &H10000". See the example program.
The function call to TrueErr *** must be the first executable statement ***
following the target error handler.
ErrorHandler: 'beginning of the error handler
z& =TrueErr() 'must be *THE* first statement!!!!
.
.
.
TrueErr will only work with module level error handlers. It will not work
with "ON LOCAL ERROR GOTO xxxx".
The shareware version has a built-in five second delay. Registration is $35.00
U.S. and includes an updated OBJ file without a delay.
Here's how to register:
Send check or money order payable in US funds to:
Thomas M. Kiehl
PO Box 693
Indian Rocks Beach, FL 34635
CIS: 73215,427
Please indicate 5-1/4 or 3-1/2 disk.